package com.yonyou.pmclouds.operation;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.util.CommonProgramConsts;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @author caihfm
 * @Description 工序
 * @date 2018/9/20 9:52
 */
@Data
@Table(name = "opr_ds_template_procedure")
public class ProcedureVO extends SuperVO {
    public static final String PK_PROCEDURE = "pkProcedure";
    @NotNull(groups = UpdateValid.class)
    @Size(min = CommonProgramConsts.UUID_STRING_LENGTH,
            max = CommonProgramConsts.UUID_STRING_LENGTH, groups = UpdateValid.class)
    @Id
    private String pkProcedure;
    private String pkTenant;
    @NotNull(groups = InsertValid.class)
    @Size(min = 1, max = 20, groups = InsertValid.class)
    private String scode;
    @NotNull
    @Size(min = 1, max = 50)
    private String sname;
    private String pkParent;
    private String pkRoot;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;
    @Transient
    private ProcedureVO[] childProcedure;

    public interface UpdateValid {
    }

    public interface InsertValid {
    }

    public ProcedureVO() {
    }

    public ProcedureVO(String scode, String sname, String pkTenant) {
        this.scode = scode;
        this.sname = sname;
        this.pkTenant = pkTenant;
    }

}
